package com.zhuiyun.project.api.complaint.service.impl;

import com.zhuiyun.project.api.complaint.entity.ComplaidFile;
import com.zhuiyun.project.api.complaint.mapper.ComplaidFileMapper;
import com.zhuiyun.project.api.complaint.model.Complaintmodel;
import com.zhuiyun.project.api.complaint.service.ComplaidFileService;
import com.zhuiyun.project.common.errorCode.EmErrorCode;
import com.zhuiyun.project.common.response.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @ClassName ComplaidFile
 * @Description TODO
 * @Author DF
 * @Date 2023/12/18 9:49
 **/
@Service
public class ComplaidFileServicImpl implements ComplaidFileService {
    @Autowired
    private ComplaidFileMapper complaidFileMapper;
    @Override
    public CommonResult SelectFile(Complaintmodel complaintmodel) {
        if (complaintmodel.getId() != null || complaintmodel.getId() != 0){
            int id = complaintmodel.getId();
            System.out.println(id);
            List<ComplaidFile> list = complaidFileMapper.selectFile(id);
            return CommonResult.ok(list);
        }
        return CommonResult.error(EmErrorCode.ID_NULL);
    }
}
